<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item to="/">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-for="(item, index) in List.data" :key="index">
      {{ item.name }}
    </el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script setup>
import { useRoute } from 'vue-router'
import { ref, computed, reactive } from 'vue'

const List = reactive({ data: [] })
const route = useRoute()
List.data = computed(() => route.matched.slice(1))
</script>
